Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Nov 20, 2025

This PR adds a proxy endpoint that allows the frontend to send OpenTelemetry traces and logs to the backend, which then forwards them to the ADOT Lambda Layer collector.

What's New

OTLP Proxy Endpoint (/docs/_api/v1/o/{signalType})

  • Proxies OTLP telemetry from frontend to local ADOT collector at localhost:4318
  • Supports traces (/o/t), logs (/o/l), and metrics (/o/m)
  • Uses adblocker-friendly URL paths (/o/* instead of /otlp/*)
  • ADOT layer handles authentication and forwarding to Elastic MOTLP

Architecture

  • OtlpProxyUsecase - Coordinates the proxy flow
  • IOtlpGateway / AdotOtlpGateway - Abstracts OTLP forwarding logic
  • OtlpProxyOptions - Configurable OTLP endpoint (defaults to ADOT at localhost:4318)
  • OtlpSignalType enum - Type-safe signal type handling with generated extensions

Testing

  • ApiWebApplicationFactory - Simplified base factory with reusable ServiceReplacementBuilder for test-specific mocks
  • OtlpProxyIntegrationTests - Comprehensive tests verifying URL construction, signal types, and error handling
  • EuidEnrichmentIntegrationTests - Updated to use new service mocking pattern

Why?

This enables distributed tracing from frontend to backend, linking user interactions (frontend spans) with API calls (backend spans) under a single trace ID, while keeping backend authentication credentials secure.

@reakaleek reakaleek changed the title Add OTLP proxy endpoint Add OTLP Proxy Endpoint for Frontend Telemetry Nov 20, 2025
@reakaleek reakaleek self-assigned this Nov 20, 2025
@reakaleek reakaleek marked this pull request as ready for review November 20, 2025 22:00
@reakaleek reakaleek requested a review from a team as a code owner November 20, 2025 22:00
@reakaleek reakaleek requested a review from Mpdreamz November 20, 2025 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants